--  --------------------------------------------------------------------------
--  @File:        pair.ads
--
--  @Project:     Softwarequalität Blatt 3 / Aufgabe 7
--  @Version:     1.0
--  @Created:     2012-11-01
--  @Author:      Benedikt Markt, Aleksander Zotov, Marcel Kranz
--
--  @Description: Package for working with an object of ADT;
--
--  @Modifications:

with Ada.Strings.Unbounded;

package Pair is

   --  -----------------------------------------------------------------------
   --  @Type:
   --
   --  @Description: Used for objects that store a pair of a value and a key.
   type Pair_Type is private;

   --  -----------------------------------------------------------------------
   --  @Function: Create
   --
   --  @Description: Creates an object of type Pair_Type;
   --  @Parameter:
   --    +Key: Value for the 'Key' parameter
   --    +Value: Value for the 'Value' parameter
   --  @Return: Created object.
   function Create (Key : String; Value : String) return Pair_Type;

   --  -----------------------------------------------------------------------
   --  @Procedure: Set_Key
   --
   --  @Description: Sets a 'Key' value for object of type Pair_Type
   --  @Parameter:
   --    +Pair: Object to modify
   --    +Key: Value for the 'Key' parameter.
   procedure Set_Key (Pair : in out Pair_Type; Key : String);

   --  -----------------------------------------------------------------------
   --  @Function: Key
   --
   --  @Description: Returns the value of 'Key'.
   --  @Parameter:
   --    +Pair: Object of which the Key value will be returned
   --  @Return: Value of 'Key' parameter.
   function Key (Pair : Pair_Type) return String;

   --  -----------------------------------------------------------------------
   --  @Procedure: Set_Value
   --
   --  @Description: Sets a 'Value' value for object of type Pair_Type
   --  @Parameter:
   --    +Pair: Object to modify
   --    +Key: Value for the 'Value' parameter.
   procedure Set_Value (Pair : in out Pair_Type; Value : String);

   --  -----------------------------------------------------------------------
   --  @Function: Value
   --
   --  @Description: Returns the value of 'Value';
   --  @Parameter:
   --    +Pair: Object of which the 'Value' value will be returned
   --  @Return: Value of 'Key' parameter.
   function Value (Pair : Pair_Type) return String;

   --  -----------------------------------------------------------------------
   --  @Function: "="
   --
   --  @Description: Checks if two objects of type Pair_Type are equal;
   --  @Parameter:
   --    +First: First object to compare.
   --    +Second:  Second object to compare.
   --  @Return: 'True' if the objects are equal. Otherwise 'False'.
   function "=" (First : Pair_Type; Second : Pair_Type) return Boolean;

private

   type Pair_Type is record
      Key : Ada.Strings.Unbounded.Unbounded_String;
      Value : Ada.Strings.Unbounded.Unbounded_String;
   end record;

end Pair;
